<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>媒体查询</title>
    <!--    当屏幕大于520px,调用某个css样式文件-->
    <!--    <link rel="stylesheet" href="xx.css" media="screen and (min-width:520px">-->
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        /* 在我们屏幕上 并且 最大宽度是800PX */
        @media screen and (max-width: 520px) {
            body {
                background-color: #8c969b;
            }

            html {
                font-size: 50px;
            }
        }

        @media screen and (min-width: 520px) and (max-width: 720px) {
            body {
                background-color: #96cdb3;
            }

            html {
                font-size: 100px;
            }
        }

        @media screen and (min-width: 720px) {
            body {
                background-color: #996b75;
            }

            html {
                font-size: 150px;
            }
        }

        .top {
            height: 1rem;
            font-size: .5rem;
            background-color: green;
            color: #fff;
            text-align: center;
            line-height: 1rem;
        }
    </style>


</head>
<body>
<div class="top">Shopping Car</div>
</body>
</html>